home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_sea_jewell_encounter1.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  151 lines

  1.  
  2. # Jones 3D Cog Script
  3. #
  4. # SEA_Cargo_Encounter1.cog
  5. # Sets up a one time scripted encounter with some commies soon after Volodnikov is alerted to Indy's escape 
  6. #
  7. # [JM]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15. message         startup
  16. message         entered
  17. message         crossed
  18. message         killed
  19. message         User0
  20. #message        timer
  21.  
  22. # ==================== SUBROUTINES ===================
  23.  
  24. flex            attack          local
  25.  
  26. # =================== REFERENCES ===============================
  27.  
  28. thing           Commie00            LinkID=1
  29. thing           Commie01            LinkID=1
  30.  
  31. surface         SurfaceTrigger00    LinkID=2
  32.  
  33. surface         AdjoinAIOn0         LinkID=3
  34. surface         AdjoinAIOn1         LinkID=3
  35. surface         AdjoinAIOn2         LinkID=3
  36.          
  37. surface         AdjoinAIOff0        LinkID=4 
  38. surface         AdjoinAIOff1        LinkID=4
  39. surface         AdjoinAIOff2        LinkID=4
  40.  
  41. thing           SoundGhost00        
  42.  
  43. # ===================== MISC LOCAL VARIABLES ===================
  44.  
  45. int         counter             local
  46. int         TempCommie          local
  47. int         StartCheck=0        local
  48.  
  49. # =========================== SOUNDS ============================
  50.  
  51. sound        DoorSound=sea_doors_open_c.wav      local
  52.  
  53.  
  54. # ==================== CONSTANTS ==========================
  55.  
  56. int         NUMBER_OF_COMMIES=2         local
  57. flex        ATTACK_DELAY=0.5            local #Needed for timing if music is inserted at a later date
  58. flex        COMMIE_ACTIVATE_DELAY=1.0   local
  59. end
  60.  
  61. # ======================= CODE =============================
  62. code
  63.  
  64. # =========================================================
  65. startup:
  66.     
  67.     for(counter = 0; counter < NUMBER_OF_COMMIES; counter = counter + 1)
  68.     {
  69.         SetThingFlags(Commie00[counter], 0x80000);
  70.     }
  71.     
  72.     return;
  73.     
  74. # =========================================================
  75. entered:
  76.  
  77.     if(GetSenderID() == 2)
  78.     {
  79.         if(StartCheck == 1) return;
  80.         
  81.         StartCheck = 1;
  82.         Call attack;
  83.     }
  84.        
  85.     
  86.     return;
  87. # =========================================================
  88. crossed:
  89.     
  90.     if(GetSenderID() == 3)
  91.     {
  92.         for(counter = 0; counter < NUMBER_OF_COMMIES; counter = counter + 1) 
  93.         {
  94.             if(Commie00[counter] != -1)
  95.                 AISetInstinctWpntMode(Commie00[counter]);
  96.         }
  97.     }
  98.     else if(GetSenderID() == 4)
  99.     {
  100.         for(counter = 0; counter < NUMBER_OF_COMMIES; counter = counter + 1)
  101.         {
  102.             if(Commie00[counter] != -1)
  103.                 AIClearInstinctWpntMode(Commie00[counter]);
  104.         }
  105.     }
  106.     
  107.     return;
  108.     
  109. # =========================================================
  110. killed:
  111.  
  112.     if(GetSenderID() == 1)
  113.     {
  114.         TempCommie = GetSenderRef();
  115.         
  116.         for(counter = 0; counter < NUMBER_OF_COMMIES; counter = counter + 1)
  117.         {
  118.             if(Commie00[counter] == TempCommie)
  119.             {
  120.                 Commie00[counter] = -1;
  121.             }
  122.         }
  123.     }
  124.     
  125.     return;
  126.     
  127. # =========================================================
  128. //The initial script for the three Commies Jumping Indy after his whip swing
  129. attack:
  130.  
  131.     sleep(ATTACK_DELAY);
  132.     
  133.     PlaySoundThing(DoorSound, SoundGhost00, 1.0, 5, 14, 0);
  134.     
  135.     sleep(COMMIE_ACTIVATE_DELAY);
  136.     
  137.     for(counter = 0; counter < NUMBER_OF_COMMIES; counter = counter + 1)
  138.     {   
  139.         ClearThingFlags(Commie00[counter], 0x80000);
  140.             
  141.         AISetInstinctWpntMode(Commie00[counter]);
  142.     }
  143.     
  144.     return;
  145.  
  146. # ============================================================
  147.  
  148. end
  149.